<%@page import="com.quicklife.util.DBUtil"%>
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>

<title>Test page</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">

<link href="ExtJS/resources/css/ext-all.css" rel="stylesheet" />
<link rel="stylesheet" type="text/css"
	href="css/start/jquery-ui-1.10.3.custom.css">
<script type="text/javascript" src="ExtJS/ext-all.js"></script>
<script type="text/javascript" src="ExtJS/locale/ext-lang-zh_CN.js"></script>
<script type="text/javascript" src="js/jquery-1.9.1.js"></script>
<script type="text/javascript" src="js/jquery-ui-1.10.3.custom.js"></script>
<script type="text/javascript">
	function test() {
		if (!$("#action").val()) {
			Ext.Msg.alert('你大爷的', 'Action不能为空.');
		} else {
			$.post("/QuickLifeServer/" + $("#action").val(), {
				actionflag : $("#actionflag").val(),
				rqinfos : $("#rqinfos").val()
			}, function(returnData, status) {
				$("#result").val(returnData);
			});
		}
	}

	$(function() {
		$(document).tooltip({
			hide : {
				effect : "fold",
				delay : 250
			},
			position : {
				at : "right,bottom"
			}
		});

		$("input[type=submit]").button().click(function(event) {
			event.preventDefault();
		});

		var availableTags = [ "WebLoginAction", "WebRegisterAction",
				"AndroidLoginAction", "AndroidRegisterAction",
				"CouponManageAction", "BussInfoManageAction",
				"CouponStatisticAction", "FeedAcion", "CouponAcion",
				"CheckInAction", "AboutMeAction", "HeartServiceAction" ];
		$("#action").autocomplete({
			source : availableTags
		});

		$("#datepicker").datepicker({
			showWeek : true,
			firstDay : 1
		}).draggable();
	});
</script>
<style type="text/css">
body {
	background-color: #C6C6C6;
	padding: 10px;
}

label {
	color: blue;
}

#mycenter {
	background: none repeat scroll 0 0 #FFFFFF;
	border-radius: 8px 8px 8px 8px;
	height: 500px;
	width: 860px;
	margin: 0 auto;
	padding: 10px;
	top: 5%;
}

#left {
	height: 450px;
	width: 210px;
	float: left;
	margin: 10px;
	padding: 5px;
	border-style: groove;
	border-width: 5pt;
	border-color: #09C;
}

#rihght {
	height: 300px;
	width: 650px;
}

#rqinfos {
	width: 200px;
	height: 150px;
	max-width: 200px;
	max-height: 250px;
}

#ok {
	margin-top: 20px
}

#result {
	height: 300px;
	width: 580px;
	margin-top: 5px;
	border-style: groove;
	border-width: 5pt;
	border-color: #09C;
	resize: none;
}

.commcolor {
	color: blue;
}

.ui-tooltip {
	font-size: 15px;
	color: blue;
}

#datepicker {
	width: 150px;
	height: 150px;
	top: 1%;
	font-size: 62.5%;
	float: left;
}
</style>
</head>

<body>
	<div id="datepicker"></div>
	<div id="mycenter">
		<div id="left">
			<div>
				<label>Action:</label><br /> <input type="text" id="action"
					title="Web----------------------------
					WebLoginAction(登陆)
					WebRegisterAction(注册)
					CouponManageAction(优惠管理)
					BussInfoManageAction(商家信息管理)
					CouponStatisticAction(优惠统计分析报表) 
					Android-------------------------
					AndroidLoginAction(登陆)
					AndroidRegisterAction(注册)
					FeedAcion(动态)
					CouponAcion(优惠)
					CheckInAction(签到)
					AboutMeAction(我)
					HeartServiceAction(心跳服务)" />
			</div>
			<div>
				<label>ActionFlag: </label><input type="text" id="actionflag"
					title="这个比较多,看思维导图" />
			</div>
			<div>
				<label>RequestInfos:</label>
				<textarea id="rqinfos" title="这个需要自己将参数拼凑成一个Json格式的字符串,参照右下测试案例"></textarea>
			</div>
			<div>
				<input id="ok" type="submit" value="提交" onclick="test()" />
			</div>
		</div>

		<div id="right">
			<label>测试结果：</label>
			<textarea id="result" disabled="disabled"></textarea>
			<br /> <br />
			<div class="commcolor">
				<label>测试案例:</label><br /> <span> Action：LoginAction</span><br />
				<span>ActionFlag：web</span><br /> <span>RequestInfos：{"login_name":"admin","password":"21232F297A57A5A743894A0E4A801FC3"}</span>
			</div>
		</div>

	</div>
</body>
</html>
